﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using SdmxMl.Structure;
using SdmxMl.Common;

namespace SdmxMl.UC
{
    public partial class UcContactOverview : UserControl
    {
        private ContactType ct;
        private string title = string.Empty;
        public UcContactOverview()
        {
            InitializeComponent();
            checkBox.Checked = false;
            textBoxName.Text = string.Empty;
        }

        /// <summary>
        /// Binded contact
        /// </summary>
        [Browsable(false)]
        public ContactType CT
        {
            get { return ct; }
            set
            {
                ct = value;
                if (ct != null)
                {
                    checkBox.Checked = ct.Name.IsEmpty == false;
                    textBoxName.Text = ct.Name.ToString();
                    if (textBoxName.Text == MultiLang.UndefinedText)
                        textBoxName.Text = string.Empty;
                }
                else
                {
                    checkBox.Checked = false;
                    textBoxName.Text = string.Empty;
                }
            }
        }


        public string Title
        {
            get { return title; }
            set
            {
                title = value;
                labelTitle.Text = title;
            }
        }

    }
}
